﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dune2013.Behaviors
{
    public class IrCargarNaftaBehavior: Behavior
    {
        public IrCargarNaftaBehavior() :
            base(){
                typeBehavior = TypeBehavior.IrA;
            }
        public override void execute(int dTime, Actor act)
        {

            base.execute(dTime, act);
            if (act.wayPoints.Count == 0)
                act.changeBehavior(new RecargarBehavior(StaticStuff.velocidadCargaNafta));

        }

        public override void enter(Actor act)
        {
            base.enter(act);
            int xPos, yPos;
            Map mapa = Game1.getInstance().map;
            xPos = (int)act.position.X / mapa.NODE_WIDTH;
            yPos = (int)act.position.Y / mapa.NODE_HEIGHT;
            act.setWaypoints(mapa.findPath(xPos, yPos, StaticStuff.stationX, StaticStuff.stationY,false));
        }

        public override void exit(Actor act)
        {
            base.exit(act);
        }
    }
}
